package com.xinnet.mms.order.service;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Service;

import com.xinnet.core.utils.page.PageView;
import com.xinnet.mms.entity.AgentConsume;
import com.xinnet.mms.entity.Customer;
import com.xinnet.mms.entity.CustomerCare;
import com.xinnet.mms.entity.CustomerConsume;
import com.xinnet.mms.entity.CustomerConsumptionDetail;

@Service
public interface OrderService {
	/**
	 * 
	 * 功能描述：根据会员id以及当前时间查询该会员某个时间区间的所有订单
	 * 
	 * @author 王湛智
	 * 
	 * @param cusId
	 * @return
	 */
	public List<CustomerCare> getOrdersByCusId(String cusId) throws Exception;
	/**
	 * 
	 * 功能描述：根据会员id以及产品ID查询该会员的订单
	 * 
	 * @author 王湛智
	 * 
	 * @param cusId
	 * @param productId
	 * @return
	 * @throws SQLException
	 */
	public List<CustomerCare> getOrdersByCusIdAndProductCode(String cusId,String productCode) throws Exception;
	
	/**
	 * 获取新订单
	 * @throws SQLException
	 */
	public List<CustomerCare> getNewOrder(String startTime,String endTime)throws SQLException;
	
	/**
	 * 获取即将到期商品
	 * @param customerCare
	 * @return
	 */
	public PageView<Customer> queryDueSoonGoods(PageView<Customer> pageView, Customer customer);
	
	/**
	 * 根据服务ID和产品Code获取服务时间
	 * @param customer
	 * @return
	 */
	public Customer getServiceTimeByServiceIdAndProductCode(Customer customer);
	
	public List<CustomerCare>  getDeldOrderList(String cusId,String productCode);
	
	/**
	 * 获取未接受的即将到期商品数量
	 * @param customer
	 * @return
	 */
	public int getDueSoonGoodsCount(Customer customer)  throws Exception;
	
	/**
	 * 通过客户ID查询购买商品
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public PageView<Customer> queryBuyGoods(PageView<Customer> pageView,
			Customer customer);
	
	/**
	 * 通过客户ID查询相关订单
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public PageView<Customer> queryOrderByCustomId(PageView<Customer> pageView,
			Customer customer);
	
	/**
	 * 分页查询会员消耗明细
	 * @param customerConsume
	 * @return
	 */
	public PageView<CustomerConsumptionDetail> getCustomerConsumptionDetail(PageView<CustomerConsumptionDetail> pageView,CustomerConsume customerConsume);
	
	/**
	 * 获取业绩明细
	 * @param customerConsume
	 * @return
	 */
	public List<AgentConsume> getAgentConsume(CustomerConsume customerConsume);
	
}
